#!/usr/bin/env python
import rospy
import time
import os,sys

class Roswtf_test():
    def __init__(self):
        rospy.init_node('roswtf_test', anonymous=True) 
        rospy.loginfo("roswtf program")    
        self.r = rospy.Rate(1)
    def spin(self):
        while not rospy.is_shutdown():
            content=os.popen("rostopic echo /rosout").readlines()
            rospy.loginfo("text: %s \n",content)
            #result='Online checks summary:' in content
            #rospy.loginfo("result: %s",result)
            self.r.sleep()

if __name__ == '__main__':
    try:
        state=Roswtf_test()
        state.spin()
    except rospy.ROSInterruptException:
	rospy.loginfo("error.")
